Skip to content

ci: clean up leftover holodeck VPCs in us-west-2 - #940

Merged
ArangoGutierrez merged 3 commits into
NVIDIA:mainfrom
abrarshivani:ci/periodic-cleanup-us-west-2
Nov 29, 2026
Merged

ArangoGutierrez merged 3 commits into
NVIDIA:mainfrom
abrarshivani:ci/periodic-cleanup-us-west-2

Conversation

@abrarshivani

Copy link
Copy Markdown
Contributor

Description

Add us-west-2 to the regions the periodic cleanup sweeps for leftover holodeck VPCs.

Motivation

  • Precompiled arm64 e2e tests run in us-west-2, which periodic cleanup skips.
  • Leaked VPCs pile up there and the pipeline fails with VpcLimitExceeded.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes)
  • 🧪 Test improvements
  • 🔨 Build/CI changes

Changes Made

  • Add us-west-2 to the aws-region matrix in periodic.yaml.

Testing

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing performed

Test Commands Run

None; workflow-only change. It can be checked with a workflow_dispatch run after merge.

Checklist

  • My code follows the project's coding conventions
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have updated the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have signed off my commits (git commit -s)

Additional Notes

The job runs with force_cleanup: 'true', which skips the GitHub run status check, as it already does for the other two regions.

The periodic cleanup only swept us-west-1 and us-east-1. The
gpu-driver-container precompiled e2e tests run their arm64 jobs in
us-west-2, so VPCs leaked there were never removed and the region kept
hitting VpcLimitExceeded.

Signed-off-by: Abrar Shivani <ashivani@nvidia.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 23:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the change extending periodic VPC cleanup to us-west-2.

No open issues 🎉

What changed in this PR

Extends periodic AWS cleanup to us-west-2, where precompiled arm64 end-to-end tests can leave Holodeck VPCs behind and exhaust the region’s VPC quota.

Changes:

  • Adds us-west-2 to the cleanup region matrix while retaining us-west-1 and us-east-1.
File Description
.github/​workflows/​periodic.yaml Includes us-west-2 in periodic VPC cleanup.

Review effort: Balanced

@abrarshivani abrarshivani self-assigned this Nov 25, 2026

@ArangoGutierrez ArangoGutierrez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the matrix entry looks right. Every step already reads matrix.aws-region, so us-west-2 gets the same credentials, VPC query, and cleanup as the other two regions.

One thing to settle before merge. With force_cleanup: 'true' the action calls DeleteVPCResources directly (cmd/action/ci/vpc_cleanup.go:88-90) and skips the job-status check in CleanupVPC. That means the 00:00 and 12:00 UTC runs delete every tagged VPC in the region, including any VPC an e2e run is still using. Nothing in this repo's workflows or tests creates VPCs in us-west-2, so the VPCs this sweeps belong to the precompiled arm64 jobs in another repo. A run of theirs that is in flight at the cron hour would lose its VPC partway through.

Holodeck already tags each VPC with GitHubRepository and GitHubRunId (pkg/provider/aws/aws.go:195-196). Could us-west-2 run without force_cleanup and with GITHUB_TOKEN passed through, so that check runs? First confirm that this repo's token can read the other repo's run status. An age cutoff would also work.

Could the description also name the repo that runs the arm64 jobs?

The periodic cleanup force-deletes every VPC tagged Project=holodeck,
Environment=cicd twice a day, including environments that are still in
use, and a failed describe-vpcs call passes green with an empty list.

These cases pin the selector the workflow will call: a VPC with an
instance younger than the age floor is skipped, an old or empty VPC is
selected in input order, and any failed aws call or unparseable
LaunchTime exits with a documented code and prints nothing, so the
cleanup never acts on a partial list. A PATH-shim aws stub serves the
fixtures and rejects calls whose filters differ from production.

The selector is a stub here, so every case fails.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
…cleanup

Every holodeck VPC carries Project=holodeck, Environment=cicd, including
one made by a local `holodeck create`, and the periodic job force-deleted
all of them at 00:00 and 12:00 UTC with no age check. Its describe-vpcs
call also ran without pipefail, so a failed call passed green with an
empty list, and one region's failure cancelled the other matrix legs.

The identify step now calls scripts/select-stale-vpcs.sh 6, which skips
any VPC holding a non-terminated instance launched less than 6 hours ago
and exits non-zero with nothing on stdout when an aws call fails or a
LaunchTime does not parse. Timestamps are compared as epochs in bash, not
through JMESPath string ordering. The 6h floor still removes a true leak
within about 18h on the 12-hourly cron. The cleanup step stays on the
pinned v0.5.1 action, so this takes effect on merge.

The steps run under shell: bash, the matrix sets fail-fast: false, the
post step reports how many VPCs were selected, and the Go workflow's
check job runs the selector tests so a regression goes red.

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 45872230564

Coverage remained the same at 51.84%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11954
Covered Lines: 6197
Line Coverage: 51.84%
Coverage Strength: 0.52 hits per line

💛 - Coveralls

@ArangoGutierrez
ArangoGutierrez merged commit d7da671 into NVIDIA:main Nov 29, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants